UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QuB4zk2A+PtIFIG8MIRPnLetm2HgRfejXVps/G6bX7s=' 
WHERE 
  key_id = '27523bac8fd1f3d7e4ec15009d1095152758085c97958682a41f4642e6b96fef' 
  AND (
    token = 'QuB4zk2A+PtIFIG8MIRPnLetm2HgRfejXVps/G6bX7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057