UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e7QyzZ9D2lmLcG1XtSCmnQZnERXZMr7fjDvyMRysJ5w=' 
WHERE 
  key_id = '9adcb623c9d8008a0a03e3f43151818d0214cde3bb339e3e694813322bf27f43' 
  AND (
    token = 'e7QyzZ9D2lmLcG1XtSCmnQZnERXZMr7fjDvyMRysJ5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033