UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qgVYE730DqKXlUwvSiaE6DlzAwn/p3/8V4xxY931XSg=' 
WHERE 
  key_id = '5ed7f624118148b851e0575f7854d5b50fe61b50123c6296ca22510b5ca7a9ac' 
  AND (
    token = 'qgVYE730DqKXlUwvSiaE6DlzAwn/p3/8V4xxY931XSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029