UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tWV4Y7gJfWhz5iq5RUBJZkxi37vFcIEA8SkHUGgpN44=' 
WHERE 
  key_id = '9d5eb92bada81a7a726bb3337ddfd0b5d5d77cea1d6a22afb6dc1eb411ccd6c0' 
  AND (
    token = 'tWV4Y7gJfWhz5iq5RUBJZkxi37vFcIEA8SkHUGgpN44=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040