UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UOWdT7Ntk1p5ft7S7882ImxtrfwnY0qj5j9fQn3xnjI=' 
WHERE 
  key_id = '7510ba9a4ec2409458cfe50810ae68767397ff0a0479f1570c94824203a3ef47' 
  AND (
    token = 'UOWdT7Ntk1p5ft7S7882ImxtrfwnY0qj5j9fQn3xnjI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049