UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't4rU9LXvWm+sHTh1jtj3Tmser6XJVe9BvBBf/ion0ZY=' 
WHERE 
  key_id = '2f615d278ec51808765e3a364ef8feb66750b8e39eb0a189dd285b9da9fef28f' 
  AND (
    token = 't4rU9LXvWm+sHTh1jtj3Tmser6XJVe9BvBBf/ion0ZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031