UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WFQQPEOAYlMEB11put9W1hEjMWB2SHuh7XC4Lqi51vw=' 
WHERE 
  key_id = 'ecffc06d449d4e1a3921765d20a6f19e484ddc4766bbc3bf637c027c7c4b380f' 
  AND (
    token = 'WFQQPEOAYlMEB11put9W1hEjMWB2SHuh7XC4Lqi51vw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055