UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w6m8IhQM5eXQp/nq7WHEAN1bGlx4XOFzJuJi3CK0W5o=' 
WHERE 
  key_id = '17a5dab2ea73faf4c44e588baf2157da93ef5f8999a3879cf1ae688d3616362d' 
  AND (
    token = 'w6m8IhQM5eXQp/nq7WHEAN1bGlx4XOFzJuJi3CK0W5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047