UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z4wom0iQhdOK5L3BIhhnYKPbxkZ8J44zS1Zxh4qhNj8=' 
WHERE 
  key_id = '6618ae259ed5772bf4046fe55c9a6e5ad948e3ffc5b3c497c4062a7a9ecf6c20' 
  AND (
    token = 'Z4wom0iQhdOK5L3BIhhnYKPbxkZ8J44zS1Zxh4qhNj8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039