UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jRET0qbdyrkdW0kJ/7FmlRvIhgcvjLwOk1Yq2QeyWkI=' 
WHERE 
  key_id = 'dba9741b049f72d4be81a3552a0ddb957f9f5ecbf539470d54e0a339eef04167' 
  AND (
    token = 'jRET0qbdyrkdW0kJ/7FmlRvIhgcvjLwOk1Yq2QeyWkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056