UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'enxuT2eVLZrUp6TvCCnDk/zyVSYSCW3b2NapJugNqN0=' 
WHERE 
  key_id = 'c545d6a872b9ea9117a5c5fb7c7cbcc360e0e569a8266b09048483db0a4e6b6d' 
  AND (
    token = 'enxuT2eVLZrUp6TvCCnDk/zyVSYSCW3b2NapJugNqN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038