UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iOtI4J7kqPVuBV/v1dZdyHUyov9njd3JPgV1S0QOHMw=' 
WHERE 
  key_id = '84e31911d9bbda5af23fc3e0f2c30c530f8571160e906a332cf0e26cfacd1043' 
  AND (
    token = 'iOtI4J7kqPVuBV/v1dZdyHUyov9njd3JPgV1S0QOHMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017