UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yqFc5mGc5HMW+Qq9I7NQSwR4JrV8kJVzIHSp0//kz44=' 
WHERE 
  key_id = '5fbc6b923413340d28ef4b6c77efb178903fc0d1ea5757d0e043817710e2f27f' 
  AND (
    token = 'yqFc5mGc5HMW+Qq9I7NQSwR4JrV8kJVzIHSp0//kz44=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034