UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+ncAXcZhXoWxhy8KG14eDSCMJ639qjDwF0/xQ6dL9CM=' 
WHERE 
  key_id = '49749d0bab8f8f844d08db00d786b014d2e8d4af98c839e245e4b3aad94070c4' 
  AND (
    token = '+ncAXcZhXoWxhy8KG14eDSCMJ639qjDwF0/xQ6dL9CM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029