UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N/03+R3WnjU8OanEgKW2Jg//I0Oo2QWCM69eBJWg2Q8=' 
WHERE 
  key_id = 'bdb269ceebaf3bd05d4c3b554623c5a88475e2a3dff198517d31d9e94dcaae1a' 
  AND (
    token = 'N/03+R3WnjU8OanEgKW2Jg//I0Oo2QWCM69eBJWg2Q8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028