UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'khqUme0P/QW30MPIWG3n/lWc2RTdGCDMSzpmeOZbFX8=' 
WHERE 
  key_id = '2a0051d273f8c70378fd4d20e9f864461b58ad9b8cff945e887b24004041fa26' 
  AND (
    token = 'khqUme0P/QW30MPIWG3n/lWc2RTdGCDMSzpmeOZbFX8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028