UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tOXcuINHYdw/Mkg4mH4qvtA8mFT02I8GfmHz5Haeomo=' 
WHERE 
  key_id = 'f6e8d8f9ecfa78baa23dc84be9ccffb594bd40bee80cf9b546c9d2cd4b773af5' 
  AND (
    token = 'tOXcuINHYdw/Mkg4mH4qvtA8mFT02I8GfmHz5Haeomo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024