UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+FeiDjkZ+1WOMgpvoMV/FVQuLrvSul4nQE6nnBsvq8A=' 
WHERE 
  key_id = 'b9db1ef73ad0168b7deed16a9d9e55d25f7d4818a934f8efcfbf9fef9c6af876' 
  AND (
    token = '+FeiDjkZ+1WOMgpvoMV/FVQuLrvSul4nQE6nnBsvq8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045