UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6+VDX64G7n5CbNrXM7riYnLdKrHKn2xTN88k7RxU62g=' 
WHERE 
  key_id = '53f125d8a905331c35add2a87236c3b08cf33b6692b1297b66611c686ad401dc' 
  AND (
    token = '6+VDX64G7n5CbNrXM7riYnLdKrHKn2xTN88k7RxU62g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043