UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x6UW7b72rcalckXSV8KEaU/4MEK9nnZ9VKsilMw0weE=' 
WHERE 
  key_id = '430209cfc51e1b1fca40234a4c451ea8940ad43b8b4b21189d98876f8307a351' 
  AND (
    token = 'x6UW7b72rcalckXSV8KEaU/4MEK9nnZ9VKsilMw0weE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045