UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '38xypnDwg+EriTMM8S8eaFKll7jAfIDXnVxDCTdFOjA=' 
WHERE 
  key_id = '3366d3f53cf0152564d8d39b9de568b1df323822b87340d130deea354d9a0dd8' 
  AND (
    token = '38xypnDwg+EriTMM8S8eaFKll7jAfIDXnVxDCTdFOjA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027