UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PD5T9Gfnqrs6sz9OnDU060Ltfv0fIPMtv5GkTR3mPKA=' 
WHERE 
  key_id = '2e7422f62bff3d1d3825f935e8b447281574aaa8f024301a494718395b9dccc6' 
  AND (
    token = 'PD5T9Gfnqrs6sz9OnDU060Ltfv0fIPMtv5GkTR3mPKA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026