UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mdjbmt47kdi1IZZ1zuUXGxJvlhgvA+Lc5V3nqz2NDvU=' 
WHERE 
  key_id = '79efe5d8bf65b9640419f4bad0e6b82279d99bf737f011c923249a0da4a0c0fa' 
  AND (
    token = 'mdjbmt47kdi1IZZ1zuUXGxJvlhgvA+Lc5V3nqz2NDvU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035