UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MukjtAuzM6livOqWn/va4TuIQcbluwSo80ZkRo09E+M=' 
WHERE 
  key_id = '13319045dc62aefd9eef8256195162f5f5d13e969b8198da8985ce8a51c04ff8' 
  AND (
    token = 'MukjtAuzM6livOqWn/va4TuIQcbluwSo80ZkRo09E+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040