UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wm1mxAKXfA4D1CMokaMpRLKg6kh0z2v5TxLN8GNq8vE=' 
WHERE 
  key_id = 'b5551565728848427bc83c725922dfd0831caf9774e7ab705f32208cb8b3edc1' 
  AND (
    token = 'Wm1mxAKXfA4D1CMokaMpRLKg6kh0z2v5TxLN8GNq8vE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022