UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aVFah/5pHdK8gLAZsUTc14e6fv6fhjnDD6L2E9Ijl2U=' 
WHERE 
  key_id = '68a3d7cbe82ca1fa4ce7e5acf2abb3a2949a73436e8c5a23185061ab83027ad5' 
  AND (
    token = 'aVFah/5pHdK8gLAZsUTc14e6fv6fhjnDD6L2E9Ijl2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017