UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DC/145ph2HN1Q9gjs6rlXUAB+0mK7E2Eq786emZ20RY=' 
WHERE 
  key_id = 'ea9625f246e9eeedf6c4eb80795a0d6c8f08d97122fb9f162f5d932f70b13a8e' 
  AND (
    token = 'DC/145ph2HN1Q9gjs6rlXUAB+0mK7E2Eq786emZ20RY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035