UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4nVFPOYsDiMIWLmetZn9A4+xotPidXl9aaxEhl2D5K8=' 
WHERE 
  key_id = 'ac6f993ca1a0e0919eecdae8defe15b2e930dcbeef06dd71a1563bfeaa11902c' 
  AND (
    token = '4nVFPOYsDiMIWLmetZn9A4+xotPidXl9aaxEhl2D5K8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024