UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZQNN3cKvOjlbhPUHwXiCizJPQw7hfUWMEL8O9k6lDLs=' 
WHERE 
  key_id = '46d03cc77cdbab312e9e11fe111b0a584bb1bf6af295f63953970ffd10371ef3' 
  AND (
    token = 'ZQNN3cKvOjlbhPUHwXiCizJPQw7hfUWMEL8O9k6lDLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044