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

Query time 0.00034