UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G3r2izKQWM6AWTHTc09Q8VzJg+bwNiXxDHJFtsZc8/8=' 
WHERE 
  key_id = 'df59115c97f260e235ecfd7f8e37cba208dff75f84c71859d7eda8ea4b46a557' 
  AND (
    token = 'G3r2izKQWM6AWTHTc09Q8VzJg+bwNiXxDHJFtsZc8/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040