UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jg9LTmfMt0jnX4m+AOlOuw1Z/YAB6fW0wc30IncOGB8=' 
WHERE 
  key_id = 'dbdf47c8162082e61a89e3de33be7c728fcea6cf2d1c4c682471a673d9a3e906' 
  AND (
    token = 'Jg9LTmfMt0jnX4m+AOlOuw1Z/YAB6fW0wc30IncOGB8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033