UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GG38KcItXmJjQ1qGhNhTxfwLJNWG840KBE2w0Gl9vME=' 
WHERE 
  key_id = '0454d2c315a5e4cacc5474b9fd9c1a0c0398fc0d3eee62a781a61ef751952f71' 
  AND (
    token = 'GG38KcItXmJjQ1qGhNhTxfwLJNWG840KBE2w0Gl9vME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053