UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ycEvWeKc1VrfNbclKXoAH0zfaSaAgobnpUeO+8N6OP0=' 
WHERE 
  key_id = '0492279a3365e4a7c0cbb5376c0aaa79f0a1b1858ce45f1f25e805b9c612fd08' 
  AND (
    token = 'ycEvWeKc1VrfNbclKXoAH0zfaSaAgobnpUeO+8N6OP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022