UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wmWnmnu2E00Zds/8NSISgWgp0RtEgaUQ/Oyb+UTKKlU=' 
WHERE 
  key_id = '39ec660d4df5938c59c8e096b249ba7f1daa6a6bf3f9caa41c98d2a5f44dca55' 
  AND (
    token = 'wmWnmnu2E00Zds/8NSISgWgp0RtEgaUQ/Oyb+UTKKlU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075